//
//  HorizontalCollectionViewCell.m
//  WWAVPlayer
//
//  Created by dllo on 15/10/30.
//  Copyright © 2015年 LZY. All rights reserved.
//

#import "HorizontalCollectionViewCell.h"

@implementation HorizontalCollectionViewCell

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.myImageView = [[UIImageView alloc] init];
        
        self.myLabel = [[UILabel alloc] init];
        
        self.myLabel.font = [UIFont systemFontOfSize:14];
        
        self.myLabel.numberOfLines = 0;
        
        [self.myLabel sizeToFit];
        
        [self.contentView addSubview:self.myLabel];
        [self.contentView addSubview:self.myImageView];
        
    }
    return self;
}
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    self.myImageView.frame = CGRectMake(10, 5 ,layoutAttributes.bounds.size.width - 20 , layoutAttributes.bounds.size.height - 5 - 20);
    
    self.myLabel.frame = CGRectMake(10, layoutAttributes.bounds.size.height  - 20 ,layoutAttributes.bounds.size.width - 20 , 20);
    
}
@end
